
import { createStore } from "vuex";
import createPersistedState from "vuex-persistedstate"

const store=createStore({
    state:{
        showDialog:false,
        manegerData:[]
    },
    mutations:{
        setShowDialog(state,bol){
            state.showDialog=bol
        },
        setManegerData(state,palyload){
            state.manegerData=palyload
        }
    },
    plugins: [createPersistedState({
        //额外配置
        //指定本地存储使用什么，默认是window.localStorage
        /* storage:window.sessionStorage,

        reducer:(state)=>{
            return {
                key:value,
                //指定存什么字段,key可以随便取名字
                username:state.username
            }
        } */
    })],
})

export default store